﻿using FirstFloor.ModernUI.Presentation;
using FirstFloor.ModernUI.Windows.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Input;

namespace EasyInvoice.WPF.ViewModel
{
    public class LogOutViewModel : NotifyPropertyChanged
    {

        public LogOutViewModel()
        {
            
                if (EasyInvoice.WPF.Properties.Settings.Default.AuthenticatedUser != null)
                {
                    EasyInvoice.WPF.Properties.Settings.Default.AuthenticatedUser = null;
                    EasyInvoice.WPF.Properties.Settings.Default.Save();
                    ((MainWindowViewModel)Application.Current.MainWindow.DataContext).SelectedLink = new Uri("/Page/Introduction.xaml", UriKind.Relative);
                    ((MainWindowViewModel)Application.Current.MainWindow.DataContext).RefreshMenus();
                }
                
            
        }
    }
}
